package edu.hawaii.senin.iclouds.plotting;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

/**
 * Simple test to see whether calculator of atoms works or not.
 * 
 * @author Pavel Senin.
 * 
 */
public class TestFractionLogParser {

  /**
   * Actual calculator test.
   */
  @Test
  public void testCalculator() {

    FractionHLogParserTask task = new FractionHLogParserTask();

    String currentMolecule = "H";
    assertEquals("Asserting H", 1, task.getHatoms(currentMolecule));

    currentMolecule = "H2";
    assertEquals("Asserting H2", 2, task.getHatoms(currentMolecule));

    currentMolecule = "H2H";
    assertEquals("Asserting H2H", 3, task.getHatoms(currentMolecule));

    currentMolecule = "CH2DOH";
    assertEquals("Asserting CH2DOH", 3, task.getHatoms(currentMolecule));

    currentMolecule = "CO2";
    assertEquals("Asserting CO2", 0, task.getHatoms(currentMolecule));

  }

}
